feat(#677): add structured needs_input signal for code agent - #1058
feat(#677): add structured needs_input signal for code agent#1058fullsend-ai-coder[bot] wants to merge 2 commits into
Conversation
When the code agent cannot proceed without human intervention (broken tooling, missing scan-secrets, uninterpretable issue), it now emits a structured needs_input signal in agent-result.json instead of silently no-oping. Changes: - Schema: add needs_input (boolean) and needs_input_reason (string) properties to code-result.schema.json - Skill: update SKILL.md steps 8/9a/9c to reference the new "Emitting needs_input" procedure section - Post-script: handle needs_input before the feature branch check — apply fs-code-needs-input label, post explanatory comment, exit 0 - Tests: add detection logic tests, comment body tests, and bundled script grep checks to post-code-test.sh - Bundle: rebuild post-code.sh from post-code.src.sh The fs-code-needs-input label is created on first use (yellow, like requires-manual-review) and reused for all causes — the comment body carries the specifics. Closes #677
|
🤖 Finished Review · ✅ Success · Started 8:43 PM UTC · Completed 9:02 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $9.02 |
|
Risk Assessment: moderate (2/5) DetailsModerate risk: well-scoped additive feature (new schema fields, post-script handling, skill updates) with bot authorship and clear issue alignment, offset by protected path modifications in scripts/ and skills/. Previous runRisk Assessment: moderate (2/5) DetailsModerate risk: a well-scoped additive feature (new schema, scripts, and skill updates) with bot authorship and clear issue alignment, offset by high churn and multi-author contention on the heavily-modified post-code scripts. |
ReviewFindingsMedium
Low
Previous runReviewFindingsHigh
Medium
Low
Labels: PR modifies code agent post-script and skill behavior Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 9:04 PM UTC · Completed 9:12 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $1.97 |
- Update SKILL.md schema compliance note to include needs_input and needs_input_reason in the allowed fields list (stale-doc, high) - Add JSON Schema if/then conditional requiring needs_input_reason when needs_input is true, matching the triage schema pattern (api-contract, medium) - Update agents/code.md structured output section to mention needs_input and needs_input_reason fields (stale-doc, medium) - Add third exit state (needs_input) to agents/code.md failure handling section (stale-doc, low) - Add fs-code-needs-input label to docs/code.md control labels table (stale-doc, medium) - Add schema validation test cases for needs_input fields in validate-code-output-test.sh (test-coverage, low) Addresses review feedback on #1058
🔧 Fix agent — iteration 1 (bot-triggered)Addressed 6 of 10 review findings with code changes. Fixed the high-severity stale allowlist in SKILL.md, added if/then schema enforcement for needs_input_reason, updated agents/code.md with new fields and exit state, added fs-code-needs-input to docs/code.md control labels table, and added 5 schema validation test cases. Disagreed with 4 findings: protected-path (informational), section-numbering (intentional), test-adequacy (environment constraint), label-naming (intentional namespacing). Fixed (6):
Disagreed (4):
Tests: passedNext steps:
|
|
🤖 Finished Review · ✅ Success · Started 9:14 PM UTC · Completed 9:35 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $8.87 |
Superseded by updated review
Summary
Adds a structured
needs_inputsignal so the code agent can explicitly say "I cannot proceed — a human needs to act" instead of silently no-oping.Problem: When the code agent encounters broken tooling, a missing
scan-secretsbinary, or a genuinely uninterpretable issue, it currently produces no informative signal — the post-script falls through to a generic "No changed files" no-op comment with no explanation.Solution: Three coordinated changes give the agent a structured way to push back:
schemas/code-result.schema.json): New optionalneeds_input(boolean) andneeds_input_reason(string) propertiesskills/code-implementation/SKILL.md): Steps 8 (uninterpretable issue), 9a (missing scan-secrets), and 9c (broken build tooling) now reference a new "Emitting needs_input" procedure sectionscripts/post-code.src.sh): Checks forneeds_inputbefore the feature branch check — appliesfs-code-needs-inputlabel to the issue, posts an explanatory comment with the agent's reason, and exits cleanly (exit 0, no PR)A single label (
fs-code-needs-input) is reused for all causes — the comment body carries the specifics.Testing
make check-bundleCloses #677
Post-script verification
agent/677-code-agent-needs-input)2fbb7da338097ad4c3d659820444c7523a0f1e63..HEAD)